Pukara::Application.routes.draw do  
  get "masters/index"

  get "requests/index"

  get "incidences/index"

  get "searches/index"

  get "cultural_heritages/index"

  namespace :cultural_heritage do resources :culture_points end

  get "incidences/gallery"

  namespace :cultural_heritage do resources :incidences_avatars end

  namespace :menu do resources :cultural_heritages end
  namespace :menu do resources :searches end
  namespace :menu do resources :incidences end
  namespace :menu do resources :requests end
  namespace :menu do resources :masters end

  namespace :cultural_heritage do 
    resources :pre_register_requests do
      get 'step_pre_register', :on=>:collection
      post 'process_step_pre_register', :on=>:collection
    end
  end

  namespace :cultural_heritage do resources :incidences do
      post :update_table, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :transfers do
      post :update_table, :on =>:collection
      post :update_table_heritage, :on =>:collection
    end
  end


  namespace :security do resources :user_roles end

  namespace :cultural_heritage do resources :care_and_maintenance_types do
      post :update_table, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :care_and_maintenances do
      post :update_table, :on =>:collection
    end
  end

 
  namespace :shared do resources :districts end

  namespace :shared do resources :provinces end

  namespace :shared do resources :departments end

  namespace :request_and_complaint do resources :complaints do
      post :update_table, :on =>:collection
    end
  end

   namespace :request_and_complaint do resources :registration_requests do
    post :update_table, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :registration_requests do
      post :update_table, :on =>:collection
    end
  end
   namespace :cultural_heritage do resources :pre_register_requests do
      post :update_table, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :cultural_heritage_properties do
      post :update_table, :on =>:collection
      post :update_assing_table, :on => :collection      
      post :create_photo, :on =>:collection
      post :save_assignments, :on => :collection
      post :create_research, :on =>:collection
      post :create_video, :on =>:collection
      post :create_model, :on =>:collection
      post :gmaps_search, :on => :collection
      get :gmaps_search, :on => :collection
    end
  end

  namespace :cultural_heritage do resources :collection_states end

  namespace :cultural_heritage do resources :collections do
      post :update_table, :on => :collection
      post :update_assing_table, :on => :collection
      post :save_assignments, :on => :collection

      post :create_photo, :on =>:collection
      post :delete_photo, :on =>:collection
    end
  end

  namespace :request_and_complaint do resources :registration_request_states end

  namespace :request_and_complaint do resources :complaint_types end

  namespace :cultural_heritage do resources :parts end

  namespace :cultural_heritage do  resources :transfers  do
      get :search, :on => :collection
    end
  end

  namespace :cultural_heritage do resources :cultural_heritage_pre_registers end

  namespace :cultural_heritage do resources :cultural_heritages do
      post :update_table, :on =>:collection
      post :create_photo, :on =>:collection
      #post :delete_photo, :on =>:collection
      post :create_research, :on =>:collection
      post :create_video, :on =>:collection
      post :create_model, :on =>:collection
      #post :show_file, :on =>:collection
      post :gmaps_search, :on => :collection
      get :gmaps_search, :on => :collection
      post :update_gmap, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :topics end

  namespace :cultural_heritage do resources :techniques end

  namespace :cultural_heritage do resources :shapes end

  namespace :cultural_heritage do resources :integrity_states end

  namespace :cultural_heritage do resources :conservational_states end

  namespace :cultural_heritage do resources :styles end

  namespace :cultural_heritage do resources :cultures do
      post :update_table, :on =>:collection
      post :create_point, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :periods do
      post :update_table, :on =>:collection
    end
  end

  namespace :cultural_heritage do resources :type_cultural_institutions end

  namespace :cultural_heritage do resources :cultural_institutions do
      post :update_table, :on =>:collection
      post :gmaps_search, :on => :collection
      get :gmaps_search, :on => :collection
    end
  end

  namespace :cultural_heritage do resources :tipologies end

  namespace :cultural_heritage do resources :sub_groups end

  namespace :cultural_heritage do resources :groups end

  namespace :cultural_heritage do resources :states end



  namespace :security do resources :people end

  

  resources :home
  root :to => "home#index"
  devise_for :users

  resources :users do
    post :update_table, :on =>:collection
  end

  #  resources :people
  #  resources :person
  #  resources :persons
  #
  #
  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => "welcome#index"

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id(.:format)))'

  #por el uso del devise
  match 'cultural_heritage/cultural_heritages/change_cultural_institutions/:id' => 'cultural_heritage/cultural_heritages#change_cultural_institutions'
  match 'cultural_heritage/cultural_heritages/change_periods/:id' => 'cultural_heritage/cultural_heritages#change_periods'
  match 'cultural_heritage/cultural_heritages/change_cultures/:id' => 'cultural_heritage/cultural_heritages#change_cultures'
  match 'cultural_heritage/cultural_heritages/change_tipologies/:group/:subgroup' => 'cultural_heritage/cultural_heritages#change_tipologies'  
  match 'request_and_complaint/complaints/change_provinces/:id' => 'request_and_complaint/complaints#change_provinces'
  match 'request_and_complaint/complaints/change_districts/:id' => 'request_and_complaint/complaints#change_districts'
  match 'request_and_complaint/registration_requests/change_provinces/:id' => 'request_and_complaint/registration_requests#change_provinces'
  match 'request_and_complaint/registration_requests/change_districts/:id' => 'request_and_complaint/registration_requests#change_districts'
  match 'cultural_heritage/cultural_heritage_properties/change_cultures/:id' => 'cultural_heritage/cultural_heritage_properties#change_cultures'

  match 'request_and_complaint/complaints/aprove/:id' => 'request_and_complaint/complaints#aprove'
  match 'request_and_complaint/complaints/reject/:id' => 'request_and_complaint/complaints#reject'
  match 'request_and_complaint/complaints/assign/:id/:complaint_responsible' => 'request_and_complaint/complaints#assign'
  match 'request_and_complaint/registration_requests/aprove/:id' => 'request_and_complaint/registration_requests#aprove'
  match 'request_and_complaint/registration_requests/reject/:id' => 'request_and_complaint/registration_requests#reject'
  match 'request_and_complaint/registration_requests/assign/:id/:registration_request_responsible' => 'request_and_complaint/registration_requests#assign'

  #   match 'cultural_heritage/cultural_heritages/approve/:id' => 'cultural_heritage/cultural_heritages#approve'
  match '/cultural_heritage/cultural_heritages/approve/:id/:search_input' =>'cultural_heritage/cultural_heritages#approve'
 match '/cultural_heritage/cultural_heritage_properties/approve/:id/:search_input' =>'cultural_heritage/cultural_heritage_properties#approve'


  match 'users/index' => 'users#index'
  match 'users/aprove/:id' => 'users#aprove'
  match 'users/reject/:id' => 'users#reject'
  match 'users/show/:id' => 'users#show'
  match 'users/delete/:id' => 'users#delete'
  match 'users/suspend/:id' => 'users#suspend'
  match 'users/edit_role_and_institution/:id' => 'users#edit_role_and_institution'
  match 'users/update_role_and_institution/:id' => 'users#update_role_and_institution'
  
  #match '/cultural_heritage/cultural_heritages/approve/:id' =>'cultural_heritage/cultural_heritages#approve'

  match 'cultural_heritage/cultural_heritages/gallery/:id' => 'cultural_heritage/cultural_heritages#gallery'
  match 'cultural_heritage/cultural_heritages/new_photo/:id' => 'cultural_heritage/cultural_heritages#new_photo'
  match 'cultural_heritage/cultural_heritages/delete_photo/:id' => 'cultural_heritage/cultural_heritages#delete_photo'
  match 'cultural_heritage/cultural_heritages/follow/:id' => 'cultural_heritage/cultural_heritages#follow'

  match 'cultural_heritage/cultural_heritage_properties/gallery/:id' => 'cultural_heritage/cultural_heritage_properties#gallery'
  match 'cultural_heritage/cultural_heritages_properties/new_photo/:id' => 'cultural_heritage/cultural_heritage_properties#new_photo'
  match 'cultural_heritage/cultural_heritages_properties/delete_photo/:id' => 'cultural_heritage/cultural_heritage_properties#delete_photo'
  match 'cultural_heritage/cultural_heritages_properties/follow/:id' => 'cultural_heritage/cultural_heritage_properties#follow'
  match 'cultural_heritage/cultural_heritages_properties/delete/:id' => 'cultural_heritage/cultural_heritage_properties#delete'
  
  match 'cultural_heritage/cultural_institutions/change_provinces/:id' => 'cultural_heritage/cultural_institutions#change_provinces'
  match 'cultural_heritage/cultural_institutions/change_districts/:id' => 'cultural_heritage/cultural_institutions#change_districts'
  match 'cultural_heritage/cultural_institutions/change_provinces_search/:id' => 'cultural_heritage/cultural_institutions#change_provinces_search'
  match 'cultural_heritage/cultural_institutions/test/' => 'cultural_heritage/cultural_institutions#test'

  match 'cultural_heritage/transfers/transfer_state/:id' => 'cultural_heritage/transfers#transfer_state'
  match 'cultural_heritage/transfers/finalize_state/:id' => 'cultural_heritage/transfers#finalize_state'
  
  match 'cultural_heritage/incidences/attend_incidence/:id' => 'cultural_heritage/incidences#attend_incidence'
  match 'cultural_heritage/incidences/attend_incidence_inc/:id' => 'cultural_heritage/incidences#attend_incidence_inc'
  match 'cultural_heritage/incidences/attend_incidence_low/:id' => 'cultural_heritage/incidences#attend_incidence_low'
  match 'cultural_heritage/incidences/deny_incidence/:id' => 'cultural_heritage/incidences#deny_incidence'
  match 'report/cultural_institution_report/show' => 'report/cultural_institution_report#show'


  match 'report/cultural_institution_report/show_pdf' => 'report/cultural_institution_report#show_pdf'
  match 'report/cultural_heritage_report/show_pdf/:id' => 'report/cultural_heritage_report#show_pdf'
  match 'cultural_heritage/cultural_heritage_properties/assing/:id' => 'cultural_heritage/cultural_heritage_properties#assing'
  match 'cultural_heritage/cultural_heritage_properties/assing_to/:cultural_heritage_id/:cultural_heritage_cultural_heritages/:assignments_list' => 'cultural_heritage/cultural_heritage_properties#assing_to'
  match 'report/complaint_report/show' => 'report/complaint_report#show'
  match 'report/registration_request_report/show' => 'report/registration_request_report#show'
  match 'report/complaint_report/show_pdf' => 'report/complaint_report#show_pdf'
  match 'report/registration_request_report/show_pdf' => 'report/registration_request_report#show_pdf'

  match 'cultural_heritage/collections/assing/:id' => 'cultural_heritage/collections#assing'
  match 'cultural_heritage/collections/assing_to/:collection_id/:cultural_heritage_cultural_heritages/:assignments_list' => 'cultural_heritage/collections#assing_to'
  match 'cultural_heritage/collections/new_photo/:id' => 'cultural_heritage/collections#new_photo'
  match 'cultural_heritage/collections/delete_photo/:id' => 'cultural_heritage/collections#delete_photo'
  match 'report/collections_report/show_pdf/:id' => 'report/collections_report#show_pdf'

  match 'cultural_heritage/care_and_maintenances/is_mayor/:id' => 'cultural_heritage/care_and_maintenances#is_mayor'
  match 'cultural_heritage/care_and_maintenances/proceed/:id' => 'cultural_heritage/care_and_maintenances#proceed'
  match 'cultural_heritage/care_and_maintenances/notapplicable/:id' => 'cultural_heritage/care_and_maintenances#notapplicable'

  match 'report/transfer_report/show' => 'report/transfer_report#show'
  match 'report/transfer_report/show_pdf' => 'report/transfer_report#show_pdf'

  match 'report/incidence_report/show' => 'report/incidence_report#show'
  match 'report/incidence_report/show_pdf' => 'report/incidence_report#show_pdf'
  match 'report/incidence_report/pdf_export' => 'report/incidence_report#pdf_export'

  match 'report/care_and_maintenance_report/show' => 'report/care_and_maintenance_report#show'
  match 'report/care_and_maintenance_report/show_pdf' => 'report/care_and_maintenance_report#show_pdf'
  match 'report/care_and_maintenance_report/pdf_export' => 'report/care_and_maintenance_report#pdf_export'

  match 'search/discovery_search/discovery_search' => 'search/discovery_search#discovery_search'

  match '/cultural_heritage/pre_register_requests/:id/change_attribute' => 'cultural_heritage/pre_register_requests#change_attribute', :via => :post
  match '/cultural_heritage/pre_register_requests/:id/delete_pre_register' => 'cultural_heritage/pre_register_requests#delete_pre_register', :via => :delete
  match '/cultural_heritage/pre_register_requests/:id/edit_pre_register' => 'cultural_heritage/pre_register_requests#edit_pre_register'
  match '/cultural_heritage/pre_register_requests/show_pre_register/:id' => 'cultural_heritage/pre_register_requests#show_pre_register'
  match '/cultural_heritage/pre_register_requests/show/:id' => 'cultural_heritage/pre_register_requests#show'
  match '/cultural_heritage/pre_register_requests/edit/:id' => 'cultural_heritage/pre_register_requests#edit'

  match 'cultural_heritage/cultural_heritages/researches/:id' => 'cultural_heritage/cultural_heritages#researches'
  match 'cultural_heritage/cultural_heritages/new_research/:id' => 'cultural_heritage/cultural_heritages#new_research'
  match 'cultural_heritage/cultural_heritages/delete_research/:id' => 'cultural_heritage/cultural_heritages#delete_research'
  match 'cultural_heritage/cultural_heritages/show_file/:id' => 'cultural_heritage/cultural_heritages#show_file'

  match 'cultural_heritage/cultural_heritages/videos/:id' => 'cultural_heritage/cultural_heritages#videos'
  match 'cultural_heritage/cultural_heritages/new_video/:id' => 'cultural_heritage/cultural_heritages#new_video'
  match 'cultural_heritage/cultural_heritages/delete_video/:id' => 'cultural_heritage/cultural_heritages#delete_video'

  match 'cultural_heritage/cultural_heritage_properties/researches/:id' => 'cultural_heritage/cultural_heritage_properties#researches'
  match 'cultural_heritage/cultural_heritage_properties/new_research/:id' => 'cultural_heritage/cultural_heritage_properties#new_research'
  match 'cultural_heritage/cultural_heritage_properties/delete_research/:id' => 'cultural_heritage/cultural_heritage_properties#delete_research'
  match 'cultural_heritage/cultural_heritage_properties/show_file/:id' => 'cultural_heritage/cultural_heritage_properties#show_file'

  match 'cultural_heritage/cultural_heritage_properties/videos/:id' => 'cultural_heritage/cultural_heritage_properties#videos'
  match 'cultural_heritage/cultural_heritage_properties/new_video/:id' => 'cultural_heritage/cultural_heritage_properties#new_video'
  match 'cultural_heritage/cultural_heritage_properties/delete_video/:id' => 'cultural_heritage/cultural_heritage_properties#delete_video'

  match 'report/pre_register_request_report/show' => 'report/pre_register_request_report#show'
  match 'report/pre_register_request_report/show_pdf' => 'report/pre_register_request_report#show_pdf'

  match 'cultural_heritage/cultural_heritages/show_research/:id' => 'cultural_heritage/cultural_heritages#show_research'
  match 'cultural_heritage/cultural_heritage_properties/show_research/:id' => 'cultural_heritage/cultural_heritage_properties#show_research'
  match 'cultural_heritage/cultural_heritage/agrupador_partes/:id'=> 'cultural_heritage/cultural_heritages#agrupador_partes'

  match 'cultural_heritage/cultural_heritages/models/:id' => 'cultural_heritage/cultural_heritages#models'
  match 'cultural_heritage/cultural_heritages/new_model/:id' => 'cultural_heritage/cultural_heritages#new_model'
  match 'cultural_heritage/cultural_heritages/delete_model/:id' => 'cultural_heritage/cultural_heritages#delete_model'

  match 'cultural_heritage/cultural_heritage_properties/models/:id' => 'cultural_heritage/cultural_heritage_properties#models'
  match 'cultural_heritage/cultural_heritage_properties/new_model/:id' => 'cultural_heritage/cultural_heritage_properties#new_model'
  match 'cultural_heritage/cultural_heritage_properties/delete_model/:id' => 'cultural_heritage/cultural_heritage_properties#delete_model'
  match 'cultural_heritage/cultural_heritages/update_parts_table/:id' => 'cultural_heritage/cultural_heritages#update_parts_table'
  match 'cultural_heritage/cultural_heritages/save_parts/:id' => 'cultural_heritage/cultural_heritages#save_parts'
  match 'cultural_heritage/cultures/list_points/:id' => 'cultural_heritage/cultures#list_points'
  match 'cultural_heritage/cultures/new_point/:id' => 'cultural_heritage/cultures#new_point'
  match 'cultural_heritage/cultures/delete_point/:id' => 'cultural_heritage/cultures#delete_point'
  match 'cultural_heritage/cultures/draw_cultures' => 'cultural_heritage/cultures#draw_cultures'
  match 'cultural_heritage/cultures/map_search/:id' => 'cultural_heritage/cultures#map_search'
  match 'cultural_heritage/cultures/map_search' => 'cultural_heritage/cultures#map_search'
end
